<!DOCTYPE html>
<html>
<head>
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?d890b1f16fb364253e79c5bb20225c3a";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>


    

    

    
<!-- Baidu Tongji -->
<script>var _hmt = _hmt || []</script>
<script async src="//hm.baidu.com/hm.js?busuanzi_value_site_uv"></script>
<!-- End Baidu Tongji -->




    <meta charset="utf-8">
    <meta name="baidu-site-verification" content="FYMCShbUK8" />
    <meta name="baidu-site-verification" content="ZYRF7OxQRW" />
    <meta name="baidu-site-verification" content="cHSqtjI0PN" />
    <meta name="baidu-site-verification" content="cHSqtjI0PN" />
    <meta name="baidu-site-verification" content="cHSqtjI0PN" />
    
    
    <link rel="canonical" href="https://hhardyy.com/2018/02/21/vue探路合集/">
    
    
    <title>vue探路合集 | 小方块 - hhardyy.com | 复杂的坑+归其原理+了解实现规则===解决？解决成功：加油解决成功;</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#958e93">
    
    
    <meta name="keywords" content="react,map,npm install,vue install,build,fsevents,vue-loader,css-split,webpack,代码抽离">
    <meta name="description" content="vue探路合集。">
<meta name="keywords" content="react,map,npm install,vue install,build,fsevents,vue-loader,css-split,webpack,代码抽离">
<meta property="og:type" content="article">
<meta property="og:title" content="vue探路合集">
<meta property="og:url" content="http://yoursite.com/2018/02/21/vue探路合集/index.html">
<meta property="og:site_name" content="小方块 - hhardyy.com">
<meta property="og:description" content="vue探路合集。">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://yoursite.com/images/npmInstall/csscodesplit.JPG">
<meta property="og:image" content="http://yoursite.com/images/npmInstall/build1bug.JPG">
<meta property="og:image" content="http://yoursite.com/images/npmInstall/npmbug1.JPG">
<meta property="og:image" content="http://yoursite.com/images/npmInstall/npmbug2.JPG">
<meta property="og:image" content="http://yoursite.com/images/npmInstall/buildbug.JPG">
<meta property="og:updated_time" content="2020-01-13T15:26:52.693Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="vue探路合集">
<meta name="twitter:description" content="vue探路合集。">
<meta name="twitter:image" content="http://yoursite.com/images/npmInstall/csscodesplit.JPG">
    
        <link rel="alternate" type="application/atom+xml" title="小方块 - hhardyy.com" href="/atom.xml">
    
    <link rel="shortcut icon" href="/hardyfavicon.ico">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/paulGraham.jpg)">
      <div class="brand" style="background-color:#4154b2">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">BingZhenhuang</h5>
          <a href="mailto:huangbingzhen@hhardyy.com" title="huangbingzhen@hhardyy.com" class="mail">huangbingzhen@hhardyy.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                所有文章
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/HHardyy" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://juejin.im/user/59a26f926fb9a02487553b04"  >
                <i class="icon icon-lg icon-pencil"></i>
                掘金-圳
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://segmentfault.com/u/hhardyy"  >
                <i class="icon icon-lg icon-comments"></i>
                Segmentfault
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://codepen.io/HHardyy/" target="_blank" >
                <i class="icon icon-lg icon-codepen"></i>
                Codepen
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/ZhenSolive/find.html" target="_blank" >
                <i class="icon icon-lg icon-globe"></i>
                原生直播间
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/hero/judge.html" target="_blank" >
                <i class="icon icon-lg icon-cloud"></i>
                原生小悟空
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/airPlay/HHardyy_PC.html" target="_blank" >
                <i class="icon icon-lg icon-camera"></i>
                原生飞机大战（PC）
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://www.freecodecamp.cn/hhardyy" target="_blank" >
                <i class="icon icon-lg icon-leaf"></i>
                Freecodecamp
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/友情链接"  >
                <i class="icon icon-lg icon-link"></i>
                友链
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">vue探路合集</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">vue探路合集</h1>
        <h5 class="subtitle">
            
                <time datetime="2018-02-21T15:53:25.000Z" itemprop="datePublished" class="page-time">
  2018-02-21
</time>


            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#css分离"><span class="post-toc-number">1.</span> <span class="post-toc-text">css分离</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#vue-loader"><span class="post-toc-number">2.</span> <span class="post-toc-text">vue-loader</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#1、假设你美滋滋install一个vue项目"><span class="post-toc-number">3.</span> <span class="post-toc-text">1、假设你美滋滋install一个vue项目</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#解决方案"><span class="post-toc-number">3.1.</span> <span class="post-toc-text">解决方案</span></a></li></ol></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#2、vue项目打包之后出现map文件，也就是-m"><span class="post-toc-number">4.</span> <span class="post-toc-text">2、vue项目打包之后出现map文件，也就是.m</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#map文件：打包后的代码经过压缩加密，如果运行报错，输出的错误信息无法准确得知是哪里的代码报错。"><span class="post-toc-number">4.1.</span> <span class="post-toc-text">map文件：打包后的代码经过压缩加密，如果运行报错，输出的错误信息无法准确得知是哪里的代码报错。</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#去掉map的方法"><span class="post-toc-number">4.2.</span> <span class="post-toc-text">去掉map的方法</span></a></li></ol></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#3、vue打包之后报错，或者每次install报错（React中也存在）"><span class="post-toc-number">5.</span> <span class="post-toc-text">3、vue打包之后报错，或者每次install报错（React中也存在）</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#产生原因"><span class="post-toc-number">5.1.</span> <span class="post-toc-text">产生原因</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#解决方案-1"><span class="post-toc-number">5.2.</span> <span class="post-toc-text">解决方案</span></a></li></ol></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#4、vue使用了ES6的promise，IE不支持"><span class="post-toc-number">6.</span> <span class="post-toc-text">4、vue使用了ES6的promise，IE不支持</span></a></li></ol>
        </nav>
    </aside>
    
<article id="post-vue探路合集"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">vue探路合集</h1>
        <div class="post-meta">
            <time class="post-time" title="2018-02-21 23:53:25" datetime="2018-02-21T15:53:25.000Z"  itemprop="datePublished">2018-02-21</time>

            


            

        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <p>vue探路合集。</p>
<p><iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="330" height="86" src="//music.163.com/outchain/player?type=2&id=165347&auto=0&height=66"></iframe><br><a id="more"></a></p>
<h3 id="css分离"><a href="#css分离" class="headerlink" title="css分离"></a>css分离</h3><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/npmInstall/csscodesplit.JPG" alt="css-code-split" title="">
                </div>
                <div class="image-caption">css-code-split</div>
            </figure>
<p>webpack打包环境优化的一个点：将css样式代码抽离出来。若不抽离，可以在bundle.js中发现css代码被转化成节点样式插入到了body下；这个过程是：style-loader将外部css文件注入到html中，css内容使用css-loader进行解析，转化成js文件；因为webpack只能识别js文件。<br>css分离：<br>使用extract-text-webpack-plugin插件，该插件的主要是为了抽离css样式,防止将样式打包在js中引起页面样式加载错乱的现象。<br>优点:<br>非js文件单独打包，通过js将文件写入，可以用来单独做浏览器缓存。<br>目前工程中大部分用到的还是webpack3+；实际中，在不指定版本的情况下，npm默认安装的4.0.0版本，这时使用上述插件会报错：<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">Error</span>: Chunk.entrypoints: Use Chunks.groupsIterable and filter by <span class="keyword">instanceof</span> Entrypoint instead</div></pre></td></tr></table></figure></p>
<p>原因：<br>extract-text-webpack-plugin还不能支持webpack4.0.0以上的版本。<br>解决办法：<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm install extract-text-webpack-plugin@next</div></pre></td></tr></table></figure></p>
<p>会下载到+ extract-text-webpack-plugin@4.0.0-beta.0<br>然后在打包就正常了</p>
<h3 id="vue-loader"><a href="#vue-loader" class="headerlink" title="vue-loader"></a>vue-loader</h3><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/npmInstall/build1bug.JPG" alt="vue-loader" title="">
                </div>
                <div class="image-caption">vue-loader</div>
            </figure>
<p>解决方案:<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">const</span> VueLoaderPlugin = <span class="built_in">require</span>(<span class="string">'vue-loader/lib/plugin'</span>);</div><div class="line"></div><div class="line">plugins: [</div><div class="line">    <span class="keyword">new</span> VueLoaderPlugin()</div><div class="line">]</div></pre></td></tr></table></figure></p>
<h3 id="1、假设你美滋滋install一个vue项目"><a href="#1、假设你美滋滋install一个vue项目" class="headerlink" title="1、假设你美滋滋install一个vue项目"></a>1、假设你美滋滋install一个vue项目</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">npm install -g vue-cli</div><div class="line">vue init webpack yourproject</div><div class="line">...</div></pre></td></tr></table></figure>
<p>这些都木有问题，接下来到npm install的时候，突然biu出来几个大写红色的ERR！，like this<br><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/npmInstall/npmbug1.JPG" alt="大写红色的ERR！" title="">
                </div>
                <div class="image-caption">大写红色的ERR！</div>
            </figure><br>那么这下或许懵逼了，可能你以为直接跑项目无视掉就好，然后就<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm run dev</div></pre></td></tr></table></figure></p>
<p>这下更厉害了，满屏幕大写红色的ERR！<br>要是可视化还好，一堆字母在这看着确实不舒服。</p>
<h4 id="解决方案"><a href="#解决方案" class="headerlink" title="解决方案"></a>解决方案</h4><p>1、跑一下这个<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm cache clean --force</div></pre></td></tr></table></figure></p>
<p>2、或者跑一下这个<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm install -g cnpm --registry=https:<span class="comment">//registry.npm.taobao.org</span></div></pre></td></tr></table></figure></p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/npmInstall/npmbug2.JPG" alt="项目就好好跑起来了" title="">
                </div>
                <div class="image-caption">项目就好好跑起来了</div>
            </figure>
<h3 id="2、vue项目打包之后出现map文件，也就是-m"><a href="#2、vue项目打包之后出现map文件，也就是-m" class="headerlink" title="2、vue项目打包之后出现map文件，也就是.m"></a>2、vue项目打包之后出现map文件，也就是.m</h3><p>vue项目打包之后的dist目录中存在很多map文件，包括打包好的项目文件。</p>
<h4 id="map文件：打包后的代码经过压缩加密，如果运行报错，输出的错误信息无法准确得知是哪里的代码报错。"><a href="#map文件：打包后的代码经过压缩加密，如果运行报错，输出的错误信息无法准确得知是哪里的代码报错。" class="headerlink" title="map文件：打包后的代码经过压缩加密，如果运行报错，输出的错误信息无法准确得知是哪里的代码报错。"></a>map文件：打包后的代码经过压缩加密，如果运行报错，输出的错误信息无法准确得知是哪里的代码报错。</h4><p>有了map可以像未加密的代码一样，准确的输出是哪一行哪一列。</p>
<h4 id="去掉map的方法"><a href="#去掉map的方法" class="headerlink" title="去掉map的方法"></a>去掉map的方法</h4><p>src-&gt;config-&gt;index.js中修改<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">productionSourceMap:<span class="literal">false</span></div></pre></td></tr></table></figure></p>
<p>改完打包就不会出现map文件了，也可以在打包之后将map文件干掉（linux下）<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">find . -name <span class="string">"*.png"</span> | xargs rm -rf</div></pre></td></tr></table></figure></p>
<h3 id="3、vue打包之后报错，或者每次install报错（React中也存在）"><a href="#3、vue打包之后报错，或者每次install报错（React中也存在）" class="headerlink" title="3、vue打包之后报错，或者每次install报错（React中也存在）"></a>3、vue打包之后报错，或者每次install报错（React中也存在）</h3><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/images/npmInstall/buildbug.JPG" alt="就像这样" title="">
                </div>
                <div class="image-caption">就像这样</div>
            </figure>
<h4 id="产生原因"><a href="#产生原因" class="headerlink" title="产生原因"></a>产生原因</h4><p>fsevents是mac osx系统的，在windows下使用了所以会有问题，或者fsevents不在package.json里，但是仍然安装了，是因为你的系统不是Windows系统，fsevents是苹果系统的可选依赖,团队的其他人在他的mac上安装了fsevents相关依赖库，所以你这里也就安装上了。</p>
<h4 id="解决方案-1"><a href="#解决方案-1" class="headerlink" title="解决方案"></a>解决方案</h4><p>1、如果是warning错误: 这个fsevents是mac下用的，windows检查你的package.json文件中是不是有fsevents相关依赖，删除即好，或者忽略掉，意思就是你已经安装成功了。<br>2、如果是error错误:<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">npm update </div><div class="line">npm install</div></pre></td></tr></table></figure></p>
<p>如果无法解决，请尝试升级node版本</p>
<h3 id="4、vue使用了ES6的promise，IE不支持"><a href="#4、vue使用了ES6的promise，IE不支持" class="headerlink" title="4、vue使用了ES6的promise，IE不支持"></a>4、vue使用了ES6的promise，IE不支持</h3><p>使用babel-polyfill转换<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm install babel-polyfill --save</div></pre></td></tr></table></figure></p>
<p>然后在webpack.config.js中引入该模块<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">require</span>(<span class="string">'babel-polyfill'</span>)</div><div class="line">entry:&#123;</div><div class="line">	app:[<span class="string">'babel-polyfill'</span>,<span class="string">'./src/main.js'</span>]</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>

        </div>

        <blockquote class="post-copyright">
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2020-01-13T15:26:52.693Z" itemprop="dateUpdated">2020-01-13 23:26:52</time>
</span><br>


        
        谢谢浏览，我会继续努力的，示例：<a href="/2018/02/21/vue探路合集/" target="_blank" rel="external">http://yoursite.com/2018/02/21/vue探路合集/</a>
        
    </div>
    <footer>
        <a href="http://yoursite.com">
            <img src="/img/avatar.jpg" alt="BingZhenhuang">
            BingZhenhuang
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/build/">build</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/css-split/">css-split</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/fsevents/">fsevents</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/map/">map</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/npm-install/">npm install</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/react/">react</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/vue-install/">vue install</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/vue-loader/">vue-loader</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/webpack/">webpack</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/代码抽离/">代码抽离</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://yoursite.com/2018/02/21/vue探路合集/&title=《vue探路合集》 — 小方块 - hhardyy.com&pic=http://yoursite.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://yoursite.com/2018/02/21/vue探路合集/&title=《vue探路合集》 — 小方块 - hhardyy.com&source=vue探路合集。
" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://yoursite.com/2018/02/21/vue探路合集/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《vue探路合集》 — 小方块 - hhardyy.com&url=http://yoursite.com/2018/02/21/vue探路合集/&via=http://yoursite.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://yoursite.com/2018/02/21/vue探路合集/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2018/03/10/vue2-0我踩过的坑，希望你别踩/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">vue2.0我踩过的坑，希望你别踩</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2018/02/05/IE-chrome-Firefox的鼠标滚轮兼容/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">IE/chrome/Firefox的鼠标滚轮兼容</h4>
      </a>
    </div>
  
</nav>



    














</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        🤠 请我喝可乐！
        <i class="icon icon-quote-right"></i>
    </h3>
    <div class="reward-content" style="width:50%">
        
        <div class="reward-code" style="text-align:center">
            <div style="width:300px;margin:0px auto;">
               <img id="rewardCode" style="width:50%;height:60%;display:block; margin:0px auto;" src="/img/alipay.jpg" alt="支付宝打赏二维码">
               <span style="display:inline-block; margin-bottom:20px;">0.88(支付宝 aliPay)</span>
               <img id="rewardCode" style="width:50%;height:60%;display:block; margin:0px auto;" src="/img/wechat.jpg" alt="微信打赏二维码">
               <span style="display:inline-block;">0.88(微信 weChat)</span>
            </div>
        </div>
    </div>
</div>



</div>

        <script>
!function(e,t,a){function n(){c(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),o(),r()}function r(){for(var e=0;e<d.length;e++)d[e].alpha<=0?(t.body.removeChild(d[e].el),d.splice(e,1)):(d[e].y--,d[e].scale+=.004,d[e].alpha-=.013,d[e].el.style.cssText="left:"+d[e].x+"px;top:"+d[e].y+"px;opacity:"+d[e].alpha+";transform:scale("+d[e].scale+","+d[e].scale+") rotate(45deg);background:"+d[e].color+";z-index:99999");requestAnimationFrame(r)}function o(){var t="function"==typeof e.onclick&&e.onclick;e.onclick=function(e){t&&t(),i(e)}}function i(e){var a=t.createElement("div");a.className="heart",d.push({el:a,x:e.clientX-5,y:e.clientY-5,scale:1,alpha:1,color:s()}),t.body.appendChild(a)}function c(e){var a=t.createElement("style");a.type="text/css";try{a.appendChild(t.createTextNode(e))}catch(t){a.styleSheet.cssText=e}t.getElementsByTagName("head")[0].appendChild(a)}function s(){return"rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")"}var d=[];e.requestAnimationFrame=function(){return e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)}}(),n()}(window,document);
</script>
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<script>
    function secondToDate(second) {
        if (!second) {
            return 0;
        }
        var time = new Array(0, 0, 0, 0, 0);
        if (second >= 365 * 24 * 3600) {
            time[0] = parseInt(second / (365 * 24 * 3600));
            second %= 365 * 24 * 3600;
        }
        if (second >= 24 * 3600) {
            time[1] = parseInt(second / (24 * 3600));
            second %= 24 * 3600;
        }
        if (second >= 3600) {
            time[2] = parseInt(second / 3600);
            second %= 3600;
        }
        if (second >= 60) {
            time[3] = parseInt(second / 60);
            second %= 60;
        }
        if (second > 0) {
            time[4] = second;
        }
        return time;
    }</script>
<script type="text/javascript" language="javascript">
    function setTime() {
        var create_time = Math.round(new Date(Date.UTC(2017, 08, 18, 11, 42, 23)).getTime() / 1000);
        var timestamp = Math.round((new Date().getTime() + 8 * 60 * 60 * 1000) / 1000);
        currentTime = secondToDate((timestamp - create_time));
        currentTimeHtml = 'Running：' + currentTime[0] + '年 ' + currentTime[1] + '天 '
                + currentTime[2] + '时 ' + currentTime[3] + '分 ' + currentTime[4]
                + '秒';
        document.getElementById("htmer_time").innerHTML = currentTimeHtml;
    }    setInterval(setTime, 1000);
</script>
<footer class="footer">
    <div class="top">
        

        <p>
          <span id="busuanzi_container_page_pv">
             [&nbsp;浏览量：&nbsp;<span id="busuanzi_value_page_pv"></span>&nbsp;]
          </span>
        </p>
    </div>
    <div class="bottom">
        <p>
        <span>BingZhenhuang &copy; 2017 - 2020</span>
            <span>
                
                Power by <a href="https://hhardyy.github.io/" target="_blank">zhen On August 8</a> 
            </span>
            <span id="htmer_time" "></span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://yoursite.com/2018/02/21/vue探路合集/&title=《vue探路合集》 — 小方块 - hhardyy.com&pic=http://yoursite.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://yoursite.com/2018/02/21/vue探路合集/&title=《vue探路合集》 — 小方块 - hhardyy.com&source=vue探路合集。
" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://yoursite.com/2018/02/21/vue探路合集/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《vue探路合集》 — 小方块 - hhardyy.com&url=http://yoursite.com/2018/02/21/vue探路合集/&via=http://yoursite.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://yoursite.com/2018/02/21/vue探路合集/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>








<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '(•‾̑⌣‾̑•)✧˖°回来看我';
            clearTimeout(titleTime);
        } else {
            document.title = '(゜-゜)つロ欢迎回来';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
